/*
 * Copyright (C) 2010-2012 Enrique Lara (enrique.posix2.lara@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
 * limitations under the License.
  */
package trs.wmata;

import app.transitalarm.model.Agency;
import app.transitalarm.model.Route;
import app.transitalarm.model.Vehicle;

public final class Bus implements Vehicle {
    private String id = "";
    private String destinationCode = "";
    private String destinationName = "";
    private int group = -1;
    private String line = "";
    private int minutes = -1;
    private String status = "";
    private final Agency agency;

    public Bus(final Agency agency) {
        this.agency = agency;
    }

    public String getId() {
        return id;
    }

    @Override
    public String getDestinationCode() {
        return destinationCode;
    }

    @Override
    public String getDestinationName() {
        return destinationName;
    }

    @Override
    public int getGroup() {
        return group;
    }

    @Override
    public String getLine() {
        return line;
    }

    @Override
    public int getMinutes() {
        return minutes;
    }

    @Override
    public String getStatus() {
        return status;
    }

    public void setId(final String id) {
        this.id = id;
    }

    public void setDestinationCode(final String destinationCode) {
        this.destinationCode = destinationCode;
    }

    public void setDestinationName(final String destinationName) {
        this.destinationName = destinationName;
    }

    public void setGroup(final int group) {
        this.group = group;
    }

    public void setLine(final String line) {
        this.line = line;
    }

    public void setMinutes(final int minutes) {
        this.minutes = minutes;
    }

    public void setStatus(final String status) {
        this.status = status;
    }

    @Override
    public Route getRoute() {
        return agency.getRouteByCode(getLine());
    }
}
